LOCAL_PATH:= $(call my-dir)

#=======================
#Build Utilities Library
#=======================
include $(CLEAR_VARS)

LOCAL_MODULE := gl2_view_Utilities
LOCAL_MODULE_FILENAME	:=	gl2_view_Utilities
LOCAL_CFLAGS    := 	-mandroid \
                  	-ffunction-sections \
                    -funwind-tables \
                    -fstack-protector \
                    -fpic \
                    -Wno-psabi \
                    -Wno-write-strings \
                    -fsigned-char \
                    -fomit-frame-pointer \
                    -fno-strict-aliasing \
                    -finline-limit=300 \
                    -ffast-math \
                    -pipe \
                    -g \
                    -w -O3 \
                    -fno-rtti \
                    -fexceptions                                   
LOCAL_SRC_FILES := 	../../../Utilities/Source/Math.cpp \
					../../../Utilities/Source/TGA.cpp \
					../../../Utilities/Source/Shader.cpp \
					../../../Utilities/Source/Device/Android.cpp \
					../../../Utilities/Source/Device/IDevice.cpp \
					../../../Utilities/Source/Device/Log.cpp \
					../../../Utilities/Source/String.cpp 
include $(BUILD_STATIC_LIBRARY)

#=======================
#Build Android Native Code
#=======================
include $(CLEAR_VARS)

LOCAL_MODULE    := 	gl2_jni_view_GL2JniLib
LOCAL_CFLAGS    := 	-mandroid \
                  	-ffunction-sections \
                    -funwind-tables \
                    -fstack-protector \
                    -fpic \
                    -Wno-psabi \
                    -Wno-write-strings \
                    -fsigned-char \
                    -fomit-frame-pointer \
                    -fno-strict-aliasing \
                    -finline-limit=300 \
                    -ffast-math \
                    -pipe \
                    -g \
                    -w -O3 \
                    -fno-rtti \
                    -fexceptions
LOCAL_CPPFLAGS 	+= 	-std=c++11
LOCAL_SRC_FILES := 	gl2_jni_view_GL2JniLib.cpp	\
					gl2_setup_view.cpp \
					../../../Sources/Source/Game.cpp \
					../../../Sources/Source/AppCore/ObjectMesh.cpp \
					../../../Sources/Source/AppCore/ObjectTexture.cpp \
					../../../Sources/Source/AppCore/ObjectShader.cpp \
					../../../Sources/Source/AppCore/ObjectEntity.cpp \
					../../../Sources/Source/Entities/Image2D.cpp
LOCAL_LDLIBS    := 	-llog -lGLESv2

LOCAL_WHOLE_STATIC_LIBRARIES :=  gl2_view_Utilities

include $(BUILD_SHARED_LIBRARY)